package com.geline.demo.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.geline.easyexcel.annotation.ExcelImport;
import com.geline.easyexcel.annotation.ExcelValid;
import com.geline.easyexcel.domain.RegexEnum;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;

@ExcelImport(value = "pipeBuilt")
@Getter
@Setter
public class PipeBuiltImportVO implements Serializable {

    //检验非空且长度<=120
    @ExcelProperty(value = "管廊项目名称", index = 0)
    @ExcelValid(notBlank = true, length = 120)
    private String projectName;

    //检验非null且为整数
    @ExcelProperty(value = "总数", index = 1)
    @ExcelValid(notNull = true, regexEnum = RegexEnum.number)
    private Integer totalNum;

    //检验非null且为小数
    @ExcelProperty(value = "断面截面尺寸", index = 2)
    @ExcelValid(notNull = true, regexEnum = RegexEnum.money)
    private BigDecimal sectionSize;

    //检验非null且保留2位小数
    @ExcelProperty(value = "总长度", index = 3)
    @ExcelValid(notNull = true, regexEnum = RegexEnum.digital_2)
    private BigDecimal totalLength;

    //检验非空且为正确的手机号
    @ExcelProperty(value = "手机号", index = 4)
    @ExcelValid(notBlank = true, regexEnum = RegexEnum.mobile)
    private String phone;

    //检验非空且为正确的邮箱
    @ExcelProperty(value = "邮箱", index = 5)
    @ExcelValid(notBlank = true, regexEnum = RegexEnum.email)
    private String email;
}
